import time

def puzirek(chisla):
    zamena = True
    while zamena:
        zamena = False
        for i in range(len(chisla) - 1):
            if chisla[i] > chisla[i + 1]:
                chisla[i], chisla[i + 1] = chisla[i + 1], chisla[i]
                zamena = True

def chitatlist(imya):
    fayl = open(imya, 'r')
    info = fayl.readlines()
    return info

spisok1 = chitatlist("m1_sorted.txt")
spisok2 = chitatlist("m2_reverse.txt")
spisok3 = chitatlist("m3_shuffle.txt")

vremya_start = vremya.time()
puzirek(spisok1)
vremya_finish = vremya.time()
print("m1_sorted",round((vremya_finish-vremya_start)*1000),"milliseconds")

vremya_start = vremya.time()
puzirek(spisok2)
vremya_finish = vremya.time()
print("m2_reverse",round((vremya_finish-vremya_start)*1000),"milliseconds")

vremya_start = vremya.time()
puzirek(spisok3)
vremya_finish = vremya.time()
print("m3_shuffle",round((vremya_finish-vremya_start)*1000),"milliseconds")